/**
 * 获取文章评论列表
 * **/
import request from '@/utils/request.js'

/**
* 获取文章评论列表
*/
export const getCommentList = params => {
  return request({
    url: 'app/v1_0/comments',
    params
  })
}

/**
* 对评论或评论回复点赞
*/
export const addCommentLike = commentId => {
  return request({
    url: 'app/v1_0/comment/likings',
    method: 'POST',
    data: {
      target: commentId
    }
  })
}

/**
* 对评论或评论回复点赞(取消)
*/
export const deleteCommentLike = commentId => {
  return request({
    url: `app/v1_0/comment/likings/${commentId}`,
    method: 'DELETE'
  })
}

/**
* 添加评论或评论回复
*/
export const addComment = data => {
  return request({
    url: 'app/v1_0/comments ',
    method: 'POST',
    data
  })
}
